package com.net;

import java.net.*;

public class API_ {
    public static void main(String[] args) throws UnknownHostException {
        InetAddress localHost = InetAddress.getLocalHost();
        System.out.println(localHost);
        //
        InetAddress host1=InetAddress.getByName("DESKTOP-G645A9F");
        System.out.println(host1);
        //
        InetAddress host2=InetAddress.getByName("www.baidu.com");
        System.out.println(host2);
    }
}
